This document outlines the main function calls for the 3 major clusters of functionality. Understanding each one of these sequences will help you find the right function to inject or customize to meet your charting needs. In cases when the same function is used multiple times within a cluster, it will be listed only once at its primary location. This was done to simplify the listings and improve readability.
draw outline
The following is an outline of the main animation loop. It draws the chart including panels, axis, and drawings.
This method is called continually as a user changes periodicity, pans or zooms the chart.
- STX.clearCanvas
- STXChart.getDefaultColor
- STXChart.drawPanels
- STXChart.correctIfOffEdge
- STXChart.createDataSegment
- STXChart.createXAxis
- STXChart.createTickXAxisWithDates
(NTB only)
- STXChart.createNumericXAxi
(numeric rendering only)
- STXChart.XAxisLabel
- STXChart.XAxis.formatte
(dates only ,not months or years)
- STX.timeAsDisplay
(if no formatter)
- STX.monthAsDisplay
- STXChart.createTickXAxisWithDates
- STXChart.initializeDisplay
- STXChart.drawXAxis
- for each plugin.drawUnder
(See STXChart#plugins)
- STXChart#displayChart
- STXChart.drawLineChart
- STXChart.drawMountainChart
- STXChart.drawWaveChart
- STXChart#drawBarChartHighPerformance
(internal)
- STXChart#drawCandles
(internal)
- STXChart#drawCandlesHighPerformance
(internal)
- STXChart#drawShadows
(internal)
- STXChart#drawShadowsHighPerformance
(internal)
- STXChart.createVolumeChart
- [STXChart.drawSeries]{@link STXChart.AdvancedInjectable#drawSeries}
- STXChart.YAxis.priceFormatter
(if defined)
- STXChart.formatYAxisPrice
(if no priceFormatter defined)
- STXChart.createYAxisLabel
- STX.drawLegend
- STXChart.YAxis.priceFormatter
- for each plugin.drawOver
(See STXChart#plugins)
- STX.Studies.displayStudies
- for each study:
- libraryEntry.seriesFN
(STX.Studies.displaySeriesAsLine default)
- libraryEntry.seriesFN
- for each study:
- STXChart.createCrosshairs
- STXChart.drawVectors
- for each vector:
- STXChart.drawCurrentHR
- STXChart.Driver#checkLoadMore
- STXChart#makeAsyncCallbacks
newChart outline
The following is an outline of the main initialization routine, used to render a chart.
It loads the data and properly sets all members and configurations, finally calling the draw loop to display the chart.
- STXChart.Driver.newChart
(if available, otherwise load data passed in)
- STXChart#setMasterData
- for each plugin.setMasterData
(See STXChart#plugins)
- for each series.addSeriesData
- for each plugin.setMasterData
- STXChart#createDataSet
- STXChart#transformDataSetPre
- printProjection
(internal)
- STXChart.consolidatedQuote
- STX.calculateRangeBars
- STX.calculateHeikenAshi
- STXChart#transformDataSetPost
- STXChart#calculateATR
(internal)
- STXChart#adjustDrawings
- for each study.calculateFN
(See Custom Studies)
- for each plugin.createDataSet
(See STXChart#plugins)
- STXChart#initializeChart
- STXChart#setTimeZone
- STXChart#registerHTMLElements
(internal)
- STXChart.adjustPanelPositions
- STXChart#calculateYAxisMargins
- STXChart#registerTouchAndMouseEvents
- STXChart.abortDrawings
(internal)
- for each plugin.initializeChart
(See STXChart#plugins)
- STXChart#setResizeTimer
- STXChart#draw
mousemoveinner outline
Core logic for handling mouse or touch movements on the chart,
which resets all chart elements to respond to user interaction and call the draw loop to render a new chart adjusted by the user inputs.
- STXChart#backOutY
- STXChart#backOutX
- STX.clearCanvas
- STXChart#displaySticky
- STXChart#setCandleWidth
(and rest of zooming logic)
- STXChart#draw
- window.requestAnimationFrame
- STXChart.undisplayCrosshairs
- STXChart.doDisplayCrosshairs
- clearTimeout
(see STXChart#updateChartAccessories)
- STXChart.AdvancedInjectable#updateChartAccessories
( manages crosshair location and labels)
- STXChart.headsUpHR
( price and date for the floating crosshair labels)
- STXChart#formatYAxisPrice
(does not use priceFormatter)
- STXChart#updateFloatHRLabel
- STXChart.XAxis#formatter
- STXChart#formatYAxisPrice
- STXChart.headsUpHR
- setTimeout
(see STXChart.AdvancedInjectable#updateChartAccessories)
- STXChart#adjustIfNecessary
- STX.Drawing#render
- STX.Drawing#move
- STX.Drawing#reposition
- STX.Drawing#measure
- STXChart#resizePanels
(internal)
- STXChart#drawTemporaryPanel
(internal)
- STXChart#findHighlights
- STXChart.magnetize